package com.bawei.composeui2207a.day04.mvi.good

import com.bawei.composeui2207a.day04.mvi.base.BaseViewModel
import com.bawei.composeui2207a.day04.mvi.base.IUiIntent
import com.bawei.composeui2207a.model.RetrofitManager

/**
 * 作者：赵亮
 * 时间：2024/12/13 16:34
 * 功能：商品相关的View Model
 */
class GoodViewModel : BaseViewModel(){

    override fun handIntent(it: IUiIntent) {
        when(it) {
            is GoodIntent.FindGoodByKeyworld -> {
                httpRequest(RetrofitManager.apiService.findCommodityByKeyword(it.keyword, it.page, it.count))
            }
        }
    }
}